package com.lsu.car.utils;

import org.apache.shiro.crypto.hash.Md5Hash;

import java.util.UUID;

/**
 * 生成md5密码
 */
public class AppMd5Utils {

    /**
     * 生成盐值
     * @return
     */
    public  String createSalt(){
        String s = UUID.randomUUID().toString().replace("-", "").toUpperCase();
        return s;

    }

    /**
     * 生成md5密码
     * @param source
     * @param salt
     * @param hashIterators
     * @return
     */
    public  String md5(String source,String salt,Integer hashIterators){
        String s = new Md5Hash(source, salt, hashIterators).toString();
        return s;
    }

    public static void main(String[] args) {
        String a = "001001";
    }
}
